package com.kaigejava.DecoratorModelzhuangshizhe.coffeebar;

import lombok.Data;

/**
 * Created by kaigejava on 2019/8/13.
 * 饮料抽象类-所有饮料的超类
 * 对应着装饰者末端的Component角色
 */
@Data
public abstract class DrinkComponent {

    /**
     * 饮料描述
     */
    public String description = "";
    /**
     * 饮料价格
     */
    private Float price = 0f;

    public String getDescription(){
        return description+".价格为:"+this.getPrice();
    }

    /**
     * 结算功能
     * @return
     */
    public abstract  Float cost();
}
